package com.kx.kxblog.exception;

import com.kx.kxblog.bean.Result;
import com.kx.kxblog.enums.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class ResultException extends RuntimeException{
    private Result<Object> result;
    public ResultException(int code, String msg) {
        result = new Result<>(code, msg);
    }
    public ResultException(ResultCode resultCode){
        result = resultCode.getResult();
    }
}
